﻿using System;
using SmartMenu.Controllers;
using visinia.SmartEngine;

public partial class Admin_Pages__Menu_MenuItem_MenuItems : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    public string GetLink(int MenuItemId)
    {
        return SystemMenu.CallPage("SmartMenu", "AddMenuItem", "MenuItemId", MenuItemId.ToString());
    }

    protected void NEW_MenuItem_Click(object sender, EventArgs e)
    {
        Response.Redirect(SystemMenu.CallPage("SmartMenu", "AddMenuItem"));
    }

    protected void GridViewMenuItems_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e)
    {
        if (e.CommandName == "DeleteMenuItem")
        {
            int menuItemId = Convert.ToInt32(e.CommandArgument);
            MenuItemController.DeleteMenuItem(menuItemId);
            Response.Redirect(Request.RawUrl);
        }
    }
}